﻿using Host;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AXImServer
{
    public class AXIMServerFactory : IHostFactory
    {
        public Host.Host CreateHost()
        {
            Host.Host host = new Host.Host();
            host.HostName = "SystemHost";

            host.AddComponentsRange(ComponentsFactory.GetAllComponentsFromAssembly("CommonComponent"));
            host.AddComponentsRange(ComponentsFactory.GetAllComponentsFromAssembly("AXImServer"));

            var http_components = host.GetComponents<HttpServerComponents>("HttpServerComponents");
            http_components.Port = 8356;

            //var udp_components = host.GetComponents<UDPServerComponents>("UDPServerComponents");
            //udp_components.Port = 8357;

            return host;
        }
    }
}
